/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package networkrespnse;

/**
 *
 * @author Kvest
 */
public abstract class Response
{
    public static final int PARSE_ERROR = -2;
    public static final int UNKNOWN_RESPONSE = -1;
    public static final int SERVER_ERROR_RESPONSE = 0;
    public static final int LOGIN_RESPONSE = 1;
    public static final int PING_RESPONSE = 2;
    public static final int SRV_MESSAGE_RESPONSE = 3;
    public static final int SRV_TRANSFERDATA_RESPONSE = 4;
    public static final int REGISTER_ON_TAXI_PARKING_RESPONSE = 5;
    public static final int RELAY_COMMUNICATION_RESPONSE = 6;
    public static final int ORDER_RESPONSE = 7;
    public static final int TCPMESSAGE_RESPONSE = 8;
    public static final int REQUEST_CONFIRMATION_RESPONSE = 9;
    public static final int TAXI_PARKING_STATISTIC_RESPONSE = 10;
    public static final int TAXI_PARKING_LAST_CHANGE_DATE_RESPONSE = 11;
    public static final int WORK_REPORT_RESPONSE = 12;
    public static final int TAXI_PARKINGS_RESPONSE = 13;
    public static final int UNREGISTER_ON_TAXI_PARKING_RESPONSE = 14;
    public static final int DRIVER_PARKING_POSITION_RESPONSE = 15;
    public static final int PPCSETTINGS_RESPONSE = 16;
    public static final int CALL_SIGNCHANGED_RESPONSE = 17;
    public static final int GET_ORDERS_RESPONSE = 18;
    public static final int SQL_RESPONSE = 19;
    public static final int PREORDERS_RESPONSE = 20;
    public static final int CSBALANCE_RESPONSE = 21;
    public static final int DRIVER_MESSAGE_RESPONSE = 22;
    public static final int ORDER_RESPONSE2 = 23;
    public static final int TAXI_PARKINGS_RESPONSE2 = 24;
    public static final int CANCEL_EFIR_ORDER = 25;
    public static final int CLEAR_EFIR = 26;
    public static final int CHANGE_STATE = 27;
    public static final int SIGN_PRELIMINARY_ORDER_ANSWER = 28;
    public static final int REFUSE_PRELIMINARY_ORDER_ANSWER = 29;
    public static final int ORDER_RESPONSE3 = 30;
    public static final int ORDER_RESPONSE4 = 31;
    public static final int SETTINGSXML_RESPONSE = 32;
    
    protected int id;
    private int packetNumber;

    public Response(int id)
    {
        this.id = id;
        this.packetNumber = -1;
    }

    public int getId()
    {
        return id;
    }

    public int getPacketNumber() 
    {
        return packetNumber;
    }

    public void setPacketNumber(int packetNumber) 
    {
        this.packetNumber = packetNumber;
    }
    
    protected abstract void parse(byte[] data);
}
